const router = require("koa-router")();
const Mock = require("mockjs");
const { list } = Mock.mock({
  "list|10": [
    {
      id: "@id",
      title: "@ctitle",
      image: "@image(150x120, @color)",
      "price|10-1000": 1,
      "count|1-10": 1,
      "type|1": ["待付款", "待发货", "待收货", "待评价"],
      "desc": "@cword(10, 20)"
    },
  ],
});

router.get("/list", (ctx) => {
  ctx.body = {
    code: 200,
    data: list,
    message: 'ok'
  }
});

module.exports = router;
